package com.sinothk.search.engine.controller;

import com.sinothk.search.engine.entity.SearchEntity;
import com.sinothk.server.support.entity.ResultData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "搜索")
@RestController
@RequestMapping("/searcher")
public class SearchEngineController {

    @ApiOperation(value = "搜索关键字", notes = "搜索关键字")
    @GetMapping("/doSearch")
    public ResultData<SearchEntity> doSearch(@ApiParam(value = "关键字", required = true) @RequestParam("keyword") String keyword) {
        SearchEntity search = new SearchEntity();
        search.setKey(keyword);
        search.setValue("结果Value");
        return new ResultData<SearchEntity>().getSuccess(search);
    }
}
